]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm: Restart only the service that failed at verification-failure
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 2 Feb 2021 16:57:45 +0000 (17:57 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 12 Feb 2021 20:26:00 +0000 (20:26 +0000)
When verification failed using a specific authentication service we're
currently restarting the whole user authentication system, which leads
to lots of unneeded operations (reinitializing a new user verifier proxy,
restarting all the gdm workers with the relative PAM modules and so on).
And this makes also debugging of login problems more complicated, given
we're cluttering the journal with repeated data.

However, at reauthentication failure GDM has already set up for us an
user verifier that we can use reuse to start only the service that had a
failure. So when possible, just start a new service instead of rebooting
the whole authorization process.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1622>

js/gdm/util.js

index 15f8de0fe07a54ad6075e7d6ca91e0151c9408d7..a98d63509b70c1c77ead1f768900d09d6b65dcb6 100644 (file)
@@ -591,9 +591,10 @@ var ShellUserVerifier = class {
         this._onReset();
     }
 
-    _retry() {
-        this.cancel();
-        this.begin(this._userName, new Batch.Hold());
+    _retry(serviceName) {
+        this._hold = new Batch.Hold();
+        this._connectSignals();
+        this._startService(serviceName);
     }
 
     _verificationFailed(serviceName, retry) {
@@ -611,13 +612,13 @@ var ShellUserVerifier = class {
 
         if (canRetry) {
             if (!this.hasPendingMessages) {
-                this._retry();
+                this._retry(serviceName);
             } else {
                 const cancellable = this._cancellable;
                 let signalId = this.connect('no-more-messages', () => {
                     this.disconnect(signalId);
                     if (!cancellable.is_cancelled())
-                        this._retry();
+                        this._retry(serviceName);
                 });
             }
         } else {